package com.zhj.micro.middleware.controller;

import com.zhj.micro.middleware.service.OrderService;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import io.swagger.annotations.Api;

@RestController
@RequestMapping("/order")
@Api("订单接口")
public class OrderController {

    @Resource
    private RabbitTemplate rabbitTemplate;

    @Resource
    private OrderService orderService;

    @GetMapping("/push")
    public boolean push() {
        rabbitTemplate.convertAndSend("order_exchange", "order_create", "hello");
        return true;
    }
}
